package com.wcgksoft.common.base;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("base")
public class BaseController  extends ExController{

	/**
	 * 
	 * @return
	 */
  //@RequiresPermissions("system:config:view")
  //@RequiresPermissions(value = {"user:a", "user:b"}, logical = Logical.OR)
	@RequestMapping(value="link/@/{href}/{url}")
	public String link(ModelMap modelMap,
                       @PathVariable(value="href") String href,
                       @PathVariable(value="url") String url,
                       @RequestParam(value = "parameter",required = false) String parameter) {
		modelMap.put("parameter", parameter);
		return ""+href+"/"+url;
	}


	/**
	 *
	 * @return
	 */
	//@RequiresUser
	@RequestMapping(value="link/@/{href}/{url}/{file}")
	public String link(ModelMap modelMap,
					   @PathVariable(value="href") String href,
					   @PathVariable(value="url") String url,
					   @PathVariable(value="file") String file,
					   @RequestParam(value = "parameter",required = false) String parameter) {
		modelMap.put("parameter", parameter);
		return ""+href+"/"+url+"/"+file;
	}
}
